package com.mx.adapt

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding

/**
 * 对比BaseSimpleAdapt：直接传入资源id，省去了重写createItem
 */
abstract class MXBaseLayoutAdapt<T>(private val layoutId: Int, list: ArrayList<T> = arrayListOf()) :
    MXBaseSimpleAdapt<T>(list) {
    override fun createItem(
        inflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): ViewBinding {
        return ViewBinding { inflater.inflate(layoutId, parent, false) }
    }
}